{"ast":null,"code":"import classNames from 'classnames';\nimport { Circle as RCCircle } from 'rc-progress';\nimport * as React from 'react';\nimport Tooltip from '../tooltip';\nimport { getPercentage, getStrokeColor } from './utils';\nconst CIRCLE_MIN_STROKE_WIDTH = 3;\nconst getMinPercent = width => CIRCLE_MIN_STROKE_WIDTH / width * 100;\nconst Circle = props => {\n  const {\n    prefixCls,\n    width = 120,\n    strokeWidth = Math.max(getMinPercent(width), 6),\n    trailColor = null,\n    strokeLinecap = 'round',\n    gapPosition,\n    gapDegree,\n    type,\n    children,\n    success\n  } = props;\n  const circleStyle = {\n    width,\n    height: width,\n    fontSize: width * 0.15 + 6\n  };\n  const realGapDegree = React.useMemo(() => {\n    // Support gapDeg = 0 when type = 'dashboard'\n    if (gapDegree || gapDegree === 0) {\n      return gapDegree;\n    }\n    if (type === 'dashboard') {\n      return 75;\n    }\n    return undefined;\n  }, [gapDegree, type]);\n  const gapPos = gapPosition || type === 'dashboard' && 'bottom' || undefined;\n  // using className to style stroke color\n  const isGradient = Object.prototype.toString.call(props.strokeColor) === '[object Object]';\n  const strokeColor = getStrokeColor({\n    success,\n    strokeColor: props.strokeColor\n  });\n  const wrapperClassName = classNames(`${prefixCls}-inner`, {\n    [`${prefixCls}-circle-gradient`]: isGradient\n  });\n  const circleContent = /*#__PURE__*/React.createElement(RCCircle, {\n    percent: getPercentage(props),\n    strokeWidth: strokeWidth,\n    trailWidth: strokeWidth,\n    strokeColor: strokeColor,\n    strokeLinecap: strokeLinecap,\n    trailColor: trailColor,\n    prefixCls: prefixCls,\n    gapDegree: realGapDegree,\n    gapPosition: gapPos\n  });\n  return /*#__PURE__*/React.createElement(\"div\", {\n    className: wrapperClassName,\n    style: circleStyle\n  }, width <= 20 ? /*#__PURE__*/React.createElement(Tooltip, {\n    title: children\n  }, circleContent) : /*#__PURE__*/React.createElement(React.Fragment, null, circleContent, children));\n};\nexport default Circle;","map":{"version":3,"names":["classNames","Circle","RCCircle","React","Tooltip","getPercentage","getStrokeColor","CIRCLE_MIN_STROKE_WIDTH","getMinPercent","width","props","prefixCls","strokeWidth","Math","max","trailColor","strokeLinecap","gapPosition","gapDegree","type","children","success","circleStyle","height","fontSize","realGapDegree","useMemo","undefined","gapPos","isGradient","Object","prototype","toString","call","strokeColor","wrapperClassName","circleContent","createElement","percent","trailWidth","className","style","title","Fragment"],"sources":["/data/messenger.client/node_modules/antd/es/progress/Circle.js"],"sourcesContent":["import classNames from 'classnames';\nimport { Circle as RCCircle } from 'rc-progress';\nimport * as React from 'react';\nimport Tooltip from '../tooltip';\nimport { getPercentage, getStrokeColor } from './utils';\nconst CIRCLE_MIN_STROKE_WIDTH = 3;\nconst getMinPercent = width => CIRCLE_MIN_STROKE_WIDTH / width * 100;\nconst Circle = props => {\n  const {\n    prefixCls,\n    width = 120,\n    strokeWidth = Math.max(getMinPercent(width), 6),\n    trailColor = null,\n    strokeLinecap = 'round',\n    gapPosition,\n    gapDegree,\n    type,\n    children,\n    success\n  } = props;\n  const circleStyle = {\n    width,\n    height: width,\n    fontSize: width * 0.15 + 6\n  };\n  const realGapDegree = React.useMemo(() => {\n    // Support gapDeg = 0 when type = 'dashboard'\n    if (gapDegree || gapDegree === 0) {\n      return gapDegree;\n    }\n    if (type === 'dashboard') {\n      return 75;\n    }\n    return undefined;\n  }, [gapDegree, type]);\n  const gapPos = gapPosition || type === 'dashboard' && 'bottom' || undefined;\n  // using className to style stroke color\n  const isGradient = Object.prototype.toString.call(props.strokeColor) === '[object Object]';\n  const strokeColor = getStrokeColor({\n    success,\n    strokeColor: props.strokeColor\n  });\n  const wrapperClassName = classNames(`${prefixCls}-inner`, {\n    [`${prefixCls}-circle-gradient`]: isGradient\n  });\n  const circleContent = /*#__PURE__*/React.createElement(RCCircle, {\n    percent: getPercentage(props),\n    strokeWidth: strokeWidth,\n    trailWidth: strokeWidth,\n    strokeColor: strokeColor,\n    strokeLinecap: strokeLinecap,\n    trailColor: trailColor,\n    prefixCls: prefixCls,\n    gapDegree: realGapDegree,\n    gapPosition: gapPos\n  });\n  return /*#__PURE__*/React.createElement(\"div\", {\n    className: wrapperClassName,\n    style: circleStyle\n  }, width <= 20 ? /*#__PURE__*/React.createElement(Tooltip, {\n    title: children\n  }, circleContent) : /*#__PURE__*/React.createElement(React.Fragment, null, circleContent, children));\n};\nexport default Circle;"],"mappings":"AAAA,OAAOA,UAAU,MAAM,YAAY;AACnC,SAASC,MAAM,IAAIC,QAAQ,QAAQ,aAAa;AAChD,OAAO,KAAKC,KAAK,MAAM,OAAO;AAC9B,OAAOC,OAAO,MAAM,YAAY;AAChC,SAASC,aAAa,EAAEC,cAAc,QAAQ,SAAS;AACvD,MAAMC,uBAAuB,GAAG,CAAC;AACjC,MAAMC,aAAa,GAAGC,KAAK,IAAIF,uBAAuB,GAAGE,KAAK,GAAG,GAAG;AACpE,MAAMR,MAAM,GAAGS,KAAK,IAAI;EACtB,MAAM;IACJC,SAAS;IACTF,KAAK,GAAG,GAAG;IACXG,WAAW,GAAGC,IAAI,CAACC,GAAG,CAACN,aAAa,CAACC,KAAK,CAAC,EAAE,CAAC,CAAC;IAC/CM,UAAU,GAAG,IAAI;IACjBC,aAAa,GAAG,OAAO;IACvBC,WAAW;IACXC,SAAS;IACTC,IAAI;IACJC,QAAQ;IACRC;EACF,CAAC,GAAGX,KAAK;EACT,MAAMY,WAAW,GAAG;IAClBb,KAAK;IACLc,MAAM,EAAEd,KAAK;IACbe,QAAQ,EAAEf,KAAK,GAAG,IAAI,GAAG;EAC3B,CAAC;EACD,MAAMgB,aAAa,GAAGtB,KAAK,CAACuB,OAAO,CAAC,MAAM;IACxC;IACA,IAAIR,SAAS,IAAIA,SAAS,KAAK,CAAC,EAAE;MAChC,OAAOA,SAAS;IAClB;IACA,IAAIC,IAAI,KAAK,WAAW,EAAE;MACxB,OAAO,EAAE;IACX;IACA,OAAOQ,SAAS;EAClB,CAAC,EAAE,CAACT,SAAS,EAAEC,IAAI,CAAC,CAAC;EACrB,MAAMS,MAAM,GAAGX,WAAW,I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